package com.bocloud.model;

import java.io.Serializable;
import java.util.List;

/**
 * Created by Administrator on 2018/12/17.
 */
public class Pagination implements Serializable {
    private int PAGE_SIZE = 3;//每页的条数
    private int currPage;//当前页
    private int totalCount;//总条数
    private int totalPage;//总页数
    private String userName;//用户名
    private String jobNum;//工号
    private List data;//返回的操作

    public void init() {
        if (this.totalCount % PAGE_SIZE == 0) {
            this.totalPage = this.totalCount / PAGE_SIZE;
        } else {
            this.totalPage = this.totalCount / PAGE_SIZE + 1;
        }
    }

    public Pagination(int PAGE_SIZE, int currPage, int totalCount, int totalPage, String userName, String jobNum, List data) {
        this.PAGE_SIZE = PAGE_SIZE;
        this.currPage = currPage;
        this.totalCount = totalCount;
        this.totalPage = totalPage;
        this.userName = userName;
        this.jobNum = jobNum;
        this.data = data;
    }

    public Pagination() {
    }

    public int getPage_Size() {
        return PAGE_SIZE;
    }

    public void setPage_Size(int PAGE_SIZE) {
        this.PAGE_SIZE = PAGE_SIZE;
    }

    public int getCurrPage() {
        return currPage;
    }

    public Integer setCurrPage(int currPage) {
        this.currPage = currPage;
        return null;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getJobNum() {
        return jobNum;
    }

    public void setJobNum(String jobNum) {
        this.jobNum = jobNum;
    }

    public List getData() {
        return data;
    }

    public void setData(List data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Pagination{" +
                "PAGE_SIZE=" + PAGE_SIZE +
                ", currPage=" + currPage +
                ", totalCount=" + totalCount +
                ", totalPage=" + totalPage +
                ", userName='" + userName + '\'' +
                ", jobNum='" + jobNum + '\'' +
                ", data=" + data +
                '}';
    }
}
